<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
%>
<html lang="zh-cn">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>  
    <link rel="stylesheet" href="<%=path %>/admin/css/pintuer.css">
    <link rel="stylesheet" href="<%=path %>/admin/css/admin.css">
    <link rel="stylesheet" href="<%=path %>/admin/css/style.css">
    <script src="<%=path %>/admin/js/jquery.js"></script>
    <script src="<%=path %>/admin/js/pintuer.js"></script>
    <link rel="stylesheet" href="<%=path %>/admin/font-awesome-4.7.0/css/font-awesome.css">  
<%--     
	<link rel="stylesheet" href="<%=path %>/static/js/picbox/css/picbox.css" />
    <script src="<%=path %>/static/js/picbox/js/jquery.rotate.js"></script>
	<script src="<%=path %>/static/js/picbox/js/picbox.js"></script> --%>
		
</head>
<body>
<form method="post" action="" id="listform">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 产品设置列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
    <div class="padding border-bottom">
      <ul class="search" style="padding-left:10px;">
        <!--<li> <a class="button border-main icon-plus-square-o" href="add.html"> 添加内容</a> </li>-->
       <!-- <li>搜索：</li>-->
     <!--    <li style='width:60%'>
          	贷款公司<input type="text" name="keywords" class="input" style="width:250px; line-height:17px;display:inline-block" />
        </li>
        <li><a href="javascript:void(0)" class="button border-main icon-search" onclick="changesearch()" > 搜索</a></li> -->
        <li><a href="javascript:void(0)" class="button border-main icon-adjust" onclick="add()" > 添加</a></li>
      </ul>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th style="text-align:left; padding-left:20px;width:5%">序号</th>
        <th style="width:10%">贷款公司</th>
        <th style="width:10%">图标</th>
        <th style="width:20%">描述</th>
        <th width="5%">状态</th>
        <th width="10%">操作</th>
      </tr>
      <volist name="list" id="vo">
      
      
      <c:forEach items="${List}" var="item" varStatus="vs">  
          	<tr>
			 <td style="text-align:left; padding-left:20px;">
                ${vs.count+pageInfo.startIndex}
            </td>
           <!--    <td><input type="text" name="sort[1]" value="1" style="width:50px; text-align:center; border:1px solid #ddd; padding:7px 0;" /></td> -->
            <td>${item.name}</td>
            <td>
				<a><img src="<%=path%>/file/getImg.html?saveAddress=${item.icon}"  width="35" height="24" /></a>
				<%-- <a><img src="<%=path %>/37b34bb9b8874f62a21ae7172ee0a2d7.png"  width="35" height="24" /></a> --%>
			</td>
			<td>${item.description}</td>
            <td>
               <c:choose>
                   <c:when test="${item.state==1}">启用</c:when>
                   <c:when test="${item.state==0}">禁用</c:when>
               </c:choose>
            </td>
			<td>
			   <div class="suspended-pos"><i class="fa fa-edit" onclick="update('${item.id}')"></i><span class="suspended">修改</span></div>
               <div class="suspended-pos"><i class="fa fa-times" onclick="remove('${item.id}')"></i><span class="suspended">删除</span></div>
			
				<%-- <div class="button-group">
					<a class="button border-main" href="<%=path %>/platfrom/update?id=${item.id}"><span class="icon-edit"></span> 修改</a> 
					<a class="button border-red" href="<%=path %>/platfrom/delete?id=${item.id}" ><span class="icon-trash-o"></span> 删除</a> 
				</div> --%>
			</td>
       
		</tr>            
	 </c:forEach>
     <c:if test="${empty List}">
		<tr>
        	<td colspan="5" class="t_c">
                <span class="no-records">暂无数据</span>
            </td>
        </tr>
      </c:if>
      <c:if test="${!empty List}">
	  <!--  <tr>
	        <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>全选 </td>
	        <td colspan="7" style="text-align:left;padding-left:20px;">
		        <a href="javascript:void(0)" class="button border-red icon-trash-o" style="padding:5px 15px;" onclick="DelSelect()"> 删除</a> 
		        <a href="javascript:void(0)" style="padding:5px 15px; margin:0 10px;" class="button border-blue icon-edit" onclick="sorts()"> 排序</a> 
	        </td>
	    </tr>  -->
	      <tr>
	        <td colspan="8">
		       <div class="pagelist"> 
		       
		       <c:choose>
				   <c:when test="${page_all<2}">  
				  <!--    <span class="current">1</span> -->
				   </c:when>
				   <c:otherwise> 
				    <a href="">上一页</a> 
			       <span class="current">1</span>
			        <c:forEach begin="2" end="${page_all}" var="i">
					  <a href="">${i}</a>
				   </c:forEach>
			       <a href="">下一页</a>
			       <a href="">尾页</a> 
				   </c:otherwise>
				</c:choose>
		       </div>
	        </td>
	      </tr>
	   </c:if>  
    </table>
  </div>
</form>
<script type="text/javascript" src="<%=path%>/admin/js/layer/layer.js" ></script>
<script type="text/javascript">

//搜索
function changesearch(){	
}

function update(id){
	window.location.href="<%=path %>/platfrom/update?id="+id;
}

function remove(id){
    layer.confirm('确定删除贷款公司吗?', {icon: 3, title:'提示'}, function(index){
    	 window.location.href="<%=path %>/platfrom/remove?id="+id;
    });
}

//添加
function add(){	
	window.location.href="<%=path %>/platfrom/add"; 
}

//单个删除
function del(id,mid,iscid){
	if(confirm("您确定要删除吗?")){
		
	}
}

//全选
$("#checkall").click(function(){ 
  $("input[name='id[]']").each(function(){
	  if (this.checked) {
		  this.checked = false;
	  }
	  else {
		  this.checked = true;
	  }
  });
})

//批量删除
function DelSelect(){
	var Checkbox=false;
	 $("input[name='id[]']").each(function(){
	  if (this.checked==true) {		
		Checkbox=true;	
	  }
	});
	if (Checkbox){
		var t=confirm("您确认要删除选中的内容吗？");
		if (t==false) return false;		
		$("#listform").submit();		
	}
	else{
		alert("请选择您要删除的内容!");
		return false;
	}
}

</script>
</body>
</html>